﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VideoNetApplication.Common;
using VideoNetApplication.Common.Helper;
using VideoNetApplication.Common.Service;

namespace VideoNetApplication
{
    public partial class UserCenterPage : System.Web.UI.MasterPage
    {
        private int _schoolId = Convert.ToInt32(ConfigurationManager.AppSettings["SchoolID"]);
        public int SchoolId
        {
            get
            {
                if (HttpContext.Current.Request["SchoolId"] != null && StringUtils.IsNumeric(HttpContext.Current.Request["SchoolId"]))
                {
                    _schoolId = Convert.ToInt32(HttpContext.Current.Request["SchoolId"]);
                }
                return _schoolId;
            }
            set { _schoolId = value; }
        }
        public V_school vSchool;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request["SchoolId"] != null && StringUtils.IsNumeric(Request["SchoolId"]))
            {

                SchoolId = Convert.ToInt32(Request["SchoolId"]);

            }
            GetSchool();

        }
        private void GetSchool()
        {
            var sm = new SchoolConfigService();
            vSchool = sm.QuerySchoolById(SchoolId);
            if (vSchool != null)
            {
                Page.Title = vSchool.VS_name;
            }
        }
    }
}
